<template>
  <div id="battle">
    <!-- 标签导航 -->
    <button
      class="goBack"
      @click="goBack"
    >
      <van-icon name="arrow-left" />
    </button>
    <div id="warpper">
      <div class="title">短信登录</div>
      <van-cell-group>
        <van-field
          v-model="tel"
          placeholder="请输入手机号"
          class="user"
        />
        <van-field
          v-model="code"
          clearable
          placeholder="请输入验证码"
          class="password"
        >
          <template #button>
            <div
              class="todo"
            >
              发送验证码
            </div>
          </template>
        </van-field>
      </van-cell-group>
      <van-button
        type="warning"
        class="login"
      >
        登录
      </van-button>
    </div>
  </div>
</template>

<script>
export default {
  name: "LoginPage",
  data() {
    return {
      // 手机号
      tel: "",
      // 验证码
      code: "",
    };
  },
  methods: {
    goBack() {
      // 编程式导航
      this.$router.push(-1);
    },
  },
};
</script>

<style lang="less">
#battle {
  width: 100%;
  height: 100%;
  margin-top: 50px;
}

.goBack {
  background-color: transparent;
  border: none;
  color: #aaa;
  font-size: 20px;
}

#warpper {
  position: relative;
  margin: 0 auto;
  margin: 32px 20px;
  .title {
    font-weight: 700;
    font-size: 24px;
    margin-bottom: 50px;
  }

  .van-cell {
    padding-left: 0px;
  }

  .password {
    display: inline-block;
    width: 50%;
  }

  .todo {
    background-color: transparent;
    width: 30%;
    position: absolute;
    top: 56px;
    right: 0;
    color: #aaa;
    font-size: 14px;
    border: none;
  }

  .van-button {
    width: 100%;
  }

  .login {
    margin-top: 50px;
    background: linear-gradient(90deg, #fe4f4f, #fc6627);
  }
}
</style>
